<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>3dchess: S:/dev/3dchess/src/ai/Negamax.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">3dchess
   </div>
   <div id="projectbrief">Basic chess application with OpenGL graphics and AI</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_128a93aeeff33a8423f079f46929dbb3.html">ai</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Negamax.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">    Copyright (c) 2013-2014, Stefan Hacker &lt;dd0t@users.sourceforge.net&gt;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">    All rights reserved.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">    Redistribution and use in source and binary forms, with or without</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">    modification, are permitted provided that the following conditions are met:</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">    1. Redistributions of source code must retain the above copyright notice,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">    this list of conditions and the following disclaimer.</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">    2. Redistributions in binary form must reproduce the above copyright</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">    notice, this list of conditions and the following disclaimer in the</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">    documentation and/or other materials provided with the distribution.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">    3. Neither the name of the copyright holder nor the names of its</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">    contributors may be used to endorse or promote products derived from</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">    this software without specific prior written permission.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment">    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment">    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment">    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment">    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment">    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment">    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment">    POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#ifndef NEGAMAX_H</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define NEGAMAX_H</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;boost/optional/optional.hpp&gt;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &lt;sstream&gt;</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &lt;array&gt;</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &lt;chrono&gt;</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &lt;atomic&gt;</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &quot;misc/helper.h&quot;</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &quot;ai/TranspositionTable.h&quot;</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#include &quot;logic/GameState.h&quot;</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#include &quot;core/Logging.h&quot;</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="struct_negamax_result.html">   50</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_negamax_result.html">NegamaxResult</a> {</div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">   52</a></span>&#160;    Score <a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a>;</div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="struct_negamax_result.html#addd03d676951914dde906d3f72c063b4">   54</a></span>&#160;    boost::optional&lt;Turn&gt; <a class="code" href="struct_negamax_result.html#addd03d676951914dde906d3f72c063b4">turn</a>;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="struct_negamax_result.html#a8cdb8ae1ae4a4713ae6ef8cc98f3b1a0">   57</a></span>&#160;    <a class="code" href="struct_negamax_result.html">NegamaxResult</a> <a class="code" href="struct_negamax_result.html#a8cdb8ae1ae4a4713ae6ef8cc98f3b1a0">operator-</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span>{ -<a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a>, <a class="code" href="struct_negamax_result.html#addd03d676951914dde906d3f72c063b4">turn</a> }; }</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    </div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="struct_negamax_result.html#ae379f4adbb195c5e48c10b583474b447">   60</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="struct_negamax_result.html#ae379f4adbb195c5e48c10b583474b447">isVictoryCertain</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a> &gt; WIN_SCORE_THRESHOLD; }</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keywordtype">bool</span> operator&lt;(<span class="keyword">const</span> <a class="code" href="struct_negamax_result.html">NegamaxResult</a>&amp; other) { <span class="keywordflow">return</span> <a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a> &lt; other.<a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a>; }</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keywordtype">bool</span> operator&lt;=(<span class="keyword">const</span> <a class="code" href="struct_negamax_result.html">NegamaxResult</a>&amp; other) { <span class="keywordflow">return</span> <a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a> &lt;= other.<a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a>; }</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordtype">bool</span> operator&gt;=(<span class="keyword">const</span> <a class="code" href="struct_negamax_result.html">NegamaxResult</a>&amp; other) { <span class="keywordflow">return</span> <a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a> &gt;= other.<a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a>; }</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordtype">bool</span> operator&gt;(<span class="keyword">const</span> <a class="code" href="struct_negamax_result.html">NegamaxResult</a> &amp;other) { <span class="keywordflow">return</span> <a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a> &gt; other.<a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a>; }</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> <a class="code" href="struct_negamax_result.html">NegamaxResult</a>&amp; other)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a> == other.<a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a> &amp;&amp; <a class="code" href="struct_negamax_result.html#addd03d676951914dde906d3f72c063b4">turn</a> == other.<a class="code" href="struct_negamax_result.html#addd03d676951914dde906d3f72c063b4">turn</a>;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    }</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    </div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    std::string toString()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        std::stringstream ss;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        ss &lt;&lt; <span class="stringliteral">&quot;Result(Score=&quot;</span> &lt;&lt; <a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a> &lt;&lt; <span class="stringliteral">&quot;, turn=&quot;</span>;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="struct_negamax_result.html#addd03d676951914dde906d3f72c063b4">turn</a>) ss &lt;&lt; <a class="code" href="struct_negamax_result.html#addd03d676951914dde906d3f72c063b4">turn</a>.get();</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <span class="keywordflow">else</span> ss &lt;&lt; <span class="stringliteral">&quot;None&quot;</span>;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        ss &lt;&lt; <span class="stringliteral">&quot;)&quot;</span>;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="keywordflow">return</span> ss.str();</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    }</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;};</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> TGameState = <a class="code" href="class_game_state.html">GameState</a>,</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;         <span class="keywordtype">bool</span> AB_CUTOFF_ENABLED = <span class="keyword">true</span>,</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;         <span class="keywordtype">bool</span> MOVE_ORDERING_ENABLED = <span class="keyword">true</span>,</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;         <span class="keywordtype">bool</span> TRANSPOSITION_TABLES_ENABLED = <span class="keyword">true</span>&gt;</div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="class_negamax.html">   93</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_negamax.html">Negamax</a> {</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="class_negamax.html#a68c8b205384caa9099b5f58a960dc13a">   98</a></span>&#160;    <a class="code" href="class_negamax.html#a68c8b205384caa9099b5f58a960dc13a">Negamax</a>()</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        : m_transpositionTable()</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        , <a class="code" href="class_negamax.html#a6d19d69f8421dd568e1d0aa5448270cb">m_abort</a>(false)</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        , m_log(Logging::initLogger(<span class="stringliteral">&quot;Negamax&quot;</span>)) {</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        <span class="comment">// Empty</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    }</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="class_negamax.html#a98943353b28ca48b5a696993fabd8a39">  111</a></span>&#160;    <a class="code" href="struct_negamax_result.html">NegamaxResult</a> <a class="code" href="class_negamax.html#a98943353b28ca48b5a696993fabd8a39">search</a>(<span class="keyword">const</span> TGameState&amp; state, <span class="keywordtype">size_t</span> maxDepth) {</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        <a class="code" href="class_negamax.html#a6d19d69f8421dd568e1d0aa5448270cb">m_abort</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        LOG(Logging::info) &lt;&lt; <span class="stringliteral">&quot;Starting &quot;</span> &lt;&lt; maxDepth</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;                           &lt;&lt; <span class="stringliteral">&quot; plies deep search. AB-pruning=&quot;</span> &lt;&lt; AB_CUTOFF_ENABLED</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;                           &lt;&lt; <span class="stringliteral">&quot; Move ordering=&quot;</span> &lt;&lt; MOVE_ORDERING_ENABLED</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;                           &lt;&lt; <span class="stringliteral">&quot; Transposition tables=&quot;</span> &lt;&lt; TRANSPOSITION_TABLES_ENABLED;</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        </div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        <span class="keyword">auto</span> start = std::chrono::steady_clock::now();</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        m_counters = PerfCounters();</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        </div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        <a class="code" href="struct_negamax_result.html">NegamaxResult</a> result = <a class="code" href="class_negamax.html#abfb76d2e30818cdaf93d77452cd7135b">search_recurse</a>(state, 0, maxDepth, MIN_SCORE, MAX_SCORE);</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        m_counters.<a class="code" href="struct_negamax_1_1_perf_counters.html#a77cda63ed3af0fb41ec4fff289229ee8">duration</a> = std::chrono::duration_cast&lt;std::chrono::milliseconds&gt;(</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;            std::chrono::steady_clock::now() - start);</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="class_negamax.html#a6d19d69f8421dd568e1d0aa5448270cb">m_abort</a>) {</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;            LOG(Logging::debug) &lt;&lt; <span class="stringliteral">&quot;Aborted without result&quot;</span>;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;            LOG(Logging::debug) &lt;&lt; result;</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        }</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        LOG(Logging::debug) &lt;&lt; m_counters;</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    }</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="class_negamax.html#a66184104466386099085c2a434da9b1e">  141</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_negamax.html#a66184104466386099085c2a434da9b1e">abort</a>() {</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;        <a class="code" href="class_negamax.html#a6d19d69f8421dd568e1d0aa5448270cb">m_abort</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    }</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;</div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="struct_negamax_1_1_perf_counters.html">  146</a></span>&#160;    <span class="keyword">struct </span><a class="code" href="struct_negamax_1_1_perf_counters.html">PerfCounters</a> {</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        <a class="code" href="struct_negamax_1_1_perf_counters.html">PerfCounters</a>()</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;            : <a class="code" href="struct_negamax_1_1_perf_counters.html#a790fb24a432ed457b9045a126159ca53">nodes</a>(0), <a class="code" href="struct_negamax_1_1_perf_counters.html#a4b44de710f2b2baa10d417d70df12205">cutoffs</a>(0), <a class="code" href="struct_negamax_1_1_perf_counters.html#a645f00407c247bbb2f29666f722e3307">updates</a>(0)</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;            , <a class="code" href="struct_negamax_1_1_perf_counters.html#a3d65699a6a64b8d20b9b8e04e041f319">transpositionTableHits</a>(0), <a class="code" href="struct_negamax_1_1_perf_counters.html#a77cda63ed3af0fb41ec4fff289229ee8">duration</a>() {}</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;        </div>
<div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="struct_negamax_1_1_perf_counters.html#a790fb24a432ed457b9045a126159ca53">  152</a></span>&#160;        uint64_t <a class="code" href="struct_negamax_1_1_perf_counters.html#a790fb24a432ed457b9045a126159ca53">nodes</a>;</div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="struct_negamax_1_1_perf_counters.html#a4b44de710f2b2baa10d417d70df12205">  154</a></span>&#160;        uint64_t <a class="code" href="struct_negamax_1_1_perf_counters.html#a4b44de710f2b2baa10d417d70df12205">cutoffs</a>;</div>
<div class="line"><a name="l00156"></a><span class="lineno"><a class="line" href="struct_negamax_1_1_perf_counters.html#a645f00407c247bbb2f29666f722e3307">  156</a></span>&#160;        uint64_t <a class="code" href="struct_negamax_1_1_perf_counters.html#a645f00407c247bbb2f29666f722e3307">updates</a>;</div>
<div class="line"><a name="l00158"></a><span class="lineno"><a class="line" href="struct_negamax_1_1_perf_counters.html#a3d65699a6a64b8d20b9b8e04e041f319">  158</a></span>&#160;        uint64_t <a class="code" href="struct_negamax_1_1_perf_counters.html#a3d65699a6a64b8d20b9b8e04e041f319">transpositionTableHits</a>;</div>
<div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="struct_negamax_1_1_perf_counters.html#a77cda63ed3af0fb41ec4fff289229ee8">  160</a></span>&#160;        std::chrono::milliseconds <a class="code" href="struct_negamax_1_1_perf_counters.html#a77cda63ed3af0fb41ec4fff289229ee8">duration</a>;</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        std::string toString()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;            std::stringstream ss;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;            <span class="keyword">const</span> <span class="keyword">auto</span> ms = <a class="code" href="struct_negamax_1_1_perf_counters.html#a77cda63ed3af0fb41ec4fff289229ee8">duration</a>.count() + 1;</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;            ss &lt;&lt; <span class="stringliteral">&quot;PerfCounters:&quot;</span> &lt;&lt; std::endl</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;               &lt;&lt; <span class="stringliteral">&quot;Search took:     &quot;</span> &lt;&lt; ms - 1&lt;&lt; <span class="stringliteral">&quot;ms&quot;</span> &lt;&lt; std::endl</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;               &lt;&lt; <span class="stringliteral">&quot;Nodes visited:   &quot;</span> &lt;&lt; <a class="code" href="struct_negamax_1_1_perf_counters.html#a790fb24a432ed457b9045a126159ca53">nodes</a> &lt;&lt; <span class="stringliteral">&quot; (~&quot;</span> &lt;&lt; <a class="code" href="struct_negamax_1_1_perf_counters.html#a790fb24a432ed457b9045a126159ca53">nodes</a> / ms &lt;&lt; <span class="stringliteral">&quot; nodes/ms)&quot;</span> &lt;&lt; std::endl</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;               &lt;&lt; <span class="stringliteral">&quot;No. of cut offs: &quot;</span> &lt;&lt; <a class="code" href="struct_negamax_1_1_perf_counters.html#a4b44de710f2b2baa10d417d70df12205">cutoffs</a> &lt;&lt; std::endl</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;               &lt;&lt; <span class="stringliteral">&quot;Result updates:  &quot;</span> &lt;&lt; <a class="code" href="struct_negamax_1_1_perf_counters.html#a645f00407c247bbb2f29666f722e3307">updates</a> &lt;&lt; std::endl</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;               &lt;&lt; <span class="stringliteral">&quot;Tr. Tbl. Hits:   &quot;</span> &lt;&lt; <a class="code" href="struct_negamax_1_1_perf_counters.html#a3d65699a6a64b8d20b9b8e04e041f319">transpositionTableHits</a> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;            </div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;            <span class="keywordflow">return</span> ss.str();</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;        }</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    } m_counters;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    </div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="class_negamax_1_1_option.html">  180</a></span>&#160;    <span class="keyword">class </span><a class="code" href="class_negamax_1_1_option.html">Option</a> {</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="keyword">public</span>:</div>
<div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="class_negamax_1_1_option.html#a904d5a20885f7018224eafbaee3d2651">  188</a></span>&#160;        <a class="code" href="class_negamax_1_1_option.html#a904d5a20885f7018224eafbaee3d2651">Option</a>(TGameState&amp; state, <a class="code" href="class_turn.html">Turn</a>&amp; turn, Score score)</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;            : state(&amp;state)</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;            , turn(&amp;turn)</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;            , score(score) {}</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;        </div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;        TGameState* state;</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;        <a class="code" href="class_turn.html">Turn</a>* turn;</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;        </div>
<div class="line"><a name="l00197"></a><span class="lineno"><a class="line" href="class_negamax_1_1_option.html#a6c602b36d333a2ac81ce657378850e60">  197</a></span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="class_negamax_1_1_option.html#a6c602b36d333a2ac81ce657378850e60">operator&lt;</a>(<span class="keyword">const</span> <a class="code" href="class_negamax_1_1_option.html">Option</a>&amp; other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> score &gt; other.<a class="code" href="class_negamax_1_1_option.html#a33bfa15db2d737b4d3f6bc8d28d762c5">score</a>; }</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    <span class="keyword">private</span>:</div>
<div class="line"><a name="l00200"></a><span class="lineno"><a class="line" href="class_negamax_1_1_option.html#a33bfa15db2d737b4d3f6bc8d28d762c5">  200</a></span>&#160;        Score <a class="code" href="class_negamax_1_1_option.html#a33bfa15db2d737b4d3f6bc8d28d762c5">score</a>;</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    };</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    </div>
<div class="line"><a name="l00211"></a><span class="lineno"><a class="line" href="class_negamax.html#abfb76d2e30818cdaf93d77452cd7135b">  211</a></span>&#160;    <a class="code" href="struct_negamax_result.html">NegamaxResult</a> <a class="code" href="class_negamax.html#abfb76d2e30818cdaf93d77452cd7135b">search_recurse</a>(TGameState state, <span class="keywordtype">size_t</span> depth, <span class="keyword">const</span> <span class="keywordtype">size_t</span> maxDepth, Score alpha, Score beta) {</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="class_negamax.html#a6d19d69f8421dd568e1d0aa5448270cb">m_abort</a>) <span class="keywordflow">return</span>{ 0, boost::none };</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">size_t</span> pliesLeft = maxDepth - depth;</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;        <span class="keywordflow">if</span> (state.isGameOver() || pliesLeft == 0) {</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;            <span class="keywordflow">return</span> { state.getScore(depth), boost::none };</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;        }</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;        </div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;        <span class="keyword">const</span> Score initialAlpha = alpha;</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;        </div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;        <span class="keywordflow">if</span> (TRANSPOSITION_TABLES_ENABLED) {</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;            <span class="keyword">auto</span> tableEntry = m_transpositionTable.<a class="code" href="class_transposition_table.html#a713913ddec0b13df5a271d9ef6a35e77">lookup</a>(state.getHash());</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;            <span class="keywordflow">if</span> (tableEntry &amp;&amp; tableEntry-&gt;depth &gt;= pliesLeft) {</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;                ++m_counters.<a class="code" href="struct_negamax_1_1_perf_counters.html#a3d65699a6a64b8d20b9b8e04e041f319">transpositionTableHits</a>;</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;                </div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;                <span class="comment">// Deep enough to use directly</span></div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;                <span class="keywordflow">if</span> (tableEntry-&gt;isExactBound()) {</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;                    <span class="comment">// This is an actual result</span></div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;                    <span class="keywordflow">return</span> { tableEntry-&gt;score, tableEntry-&gt;turn };</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;                } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (tableEntry-&gt;isLowerBound()) {</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;                    <span class="comment">// We have a lower bound, adjust alpha accordingly</span></div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;                    alpha = std::max(alpha, tableEntry-&gt;score);</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;                    assert(tableEntry-&gt;isUpperBound());</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;                    <span class="comment">// Upper bound, adjust beta</span></div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;                    beta = std::min(beta, tableEntry-&gt;score);</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;                }</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;                </div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;                <span class="keywordflow">if</span> (AB_CUTOFF_ENABLED &amp;&amp; alpha &gt;= beta) {</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;                    <span class="comment">// Upper or lower bound known for this position will</span></div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;                    <span class="comment">// trigger an alpha beta cutoff. No need to continue</span></div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;                    <span class="comment">// search.</span></div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;                    ++m_counters.<a class="code" href="struct_negamax_1_1_perf_counters.html#a4b44de710f2b2baa10d417d70df12205">cutoffs</a>;</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;                    <span class="keywordflow">return</span> { tableEntry-&gt;score, tableEntry-&gt;turn };</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;                }</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;            }</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;        }</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;        <a class="code" href="struct_negamax_result.html">NegamaxResult</a> bestResult { MIN_SCORE, boost::none };</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;        </div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;        std::vector&lt;Turn&gt; possibleTurns = state.getTurnList();</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;        assert(possibleTurns.size() &gt; 0);</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;        </div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;        </div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;        std::vector&lt;TGameState&gt; consideredStates(possibleTurns.size(), state);</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;        std::vector&lt;Option&gt; consideredOptions;</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;        </div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;        consideredOptions.reserve(possibleTurns.size());</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;        </div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;        <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; possibleTurns.size(); ++i) {</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;            <span class="comment">// Need to apply all states at this point to be able to</span></div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;            <span class="comment">// use their data for move ordering.</span></div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;            consideredStates[i].applyTurn(possibleTurns[i]);</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;            consideredOptions.emplace_back(consideredStates[i],</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;                                             possibleTurns[i],</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;                                             <a class="code" href="class_negamax.html#a975aeca01f30cba138118127f7c541d2">estimateScoreFor</a>(consideredStates[i],</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;                                                             depth + 1));</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;        }</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;        </div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;        <span class="keywordflow">if</span> (MOVE_ORDERING_ENABLED) {</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;            std::sort(begin(consideredOptions), end(consideredOptions));</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        }</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;        </div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;        <span class="keywordflow">for</span> (Option&amp; option: consideredOptions) {</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;            <a class="code" href="class_turn.html">Turn</a>&amp; turn = *option.turn;</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;            TGameState&amp; newState = *option.state;</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;            </div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;            ++m_counters.<a class="code" href="struct_negamax_1_1_perf_counters.html#a790fb24a432ed457b9045a126159ca53">nodes</a>;</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;            <a class="code" href="struct_negamax_result.html">NegamaxResult</a> result = -<a class="code" href="class_negamax.html#abfb76d2e30818cdaf93d77452cd7135b">search_recurse</a>(</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;                        newState, depth + 1, maxDepth,</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;                        -beta, -alpha);</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;            <span class="comment">// Check if we improved upon previous turns</span></div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;            <span class="keywordflow">if</span> (result &gt; bestResult) {</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;                ++m_counters.<a class="code" href="struct_negamax_1_1_perf_counters.html#a645f00407c247bbb2f29666f722e3307">updates</a>;</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;                bestResult = result;</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;                bestResult.<a class="code" href="struct_negamax_result.html#addd03d676951914dde906d3f72c063b4">turn</a> = turn;</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;            }</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;            alpha = std::max(alpha, result.<a class="code" href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">score</a>);</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;            <span class="keywordflow">if</span> (AB_CUTOFF_ENABLED &amp;&amp; alpha &gt;= beta) {</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;                ++m_counters.<a class="code" href="struct_negamax_1_1_perf_counters.html#a4b44de710f2b2baa10d417d70df12205">cutoffs</a>;</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;                <span class="comment">// Enemy player won&#39;t let us reach a better score than</span></div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;                <span class="comment">// his guaranteed beta score. No use in continuing to</span></div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;                <span class="comment">// search this position as the results would be discarded</span></div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;                <span class="comment">// anyways.</span></div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;            }</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="class_negamax.html#a6d19d69f8421dd568e1d0aa5448270cb">m_abort</a>) <span class="keywordflow">return</span>{ 0, boost::none };</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;        }</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;        </div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;        <span class="keywordflow">if</span> (TRANSPOSITION_TABLES_ENABLED) {</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;            assert(bestResult.turn);</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;            <a class="code" href="struct_transposition_table_entry.html">TranspositionTableEntry</a> entry;</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;            entry.<a class="code" href="struct_transposition_table_entry.html#a21cb85b29cd2ce47beb1dd33142972dd">score</a> = bestResult.score;</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;            entry.<a class="code" href="struct_transposition_table_entry.html#a8bd05e778a4778fa23ff10d2e8e11d0f">turn</a> = *bestResult.turn;</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;            entry.<a class="code" href="struct_transposition_table_entry.html#a03beac3a305cdbb97c721a8d8a5cee85">hash</a> = state.getHash();</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;            entry.<a class="code" href="struct_transposition_table_entry.html#a079ff462c7ade9cd06f34b0909181eb7">depth</a> = pliesLeft; <span class="comment">// Our results comes from pliesLeft deep</span></div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    </div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;            <span class="keywordflow">if</span> (bestResult.score &lt;= initialAlpha) {</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;                <span class="comment">// Opponent might have omitted results with a lower score from</span></div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;                <span class="comment">// this position meaning this is a upper bound.</span></div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;                entry.boundType = <a class="code" href="struct_transposition_table_entry.html#adc45c3e738f27e694c924a8df6d12302adb28373902f1e677ebabe3990d92543c">TranspositionTableEntry::UPPER</a>;</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (bestResult.score &gt;= beta) {</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;                <span class="comment">// We might have omitted results with a higher score from this position</span></div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;                <span class="comment">// meaning this is a lower bound.</span></div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;                entry.boundType = <a class="code" href="struct_transposition_table_entry.html#adc45c3e738f27e694c924a8df6d12302afb27cd323a1d9066ba4fd804b7f9b710">TranspositionTableEntry::LOWER</a>;</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;                <span class="comment">// No cutoff occured. The result is exact.</span></div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;                entry.boundType = <a class="code" href="struct_transposition_table_entry.html#adc45c3e738f27e694c924a8df6d12302a0ce401f3ea88d764db8bd6a2bd5bccb1">TranspositionTableEntry::EXACT</a>;</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;            }</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;            </div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;            m_transpositionTable.<a class="code" href="class_transposition_table.html#a5660b5b0b08775bbd270fc9b6f601176">maybeUpdate</a>(entry);</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;        }</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;        </div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;        <span class="keywordflow">return</span> bestResult;</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;    }</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;    </div>
<div class="line"><a name="l00344"></a><span class="lineno"><a class="line" href="class_negamax.html#a975aeca01f30cba138118127f7c541d2">  344</a></span>&#160;    Score <a class="code" href="class_negamax.html#a975aeca01f30cba138118127f7c541d2">estimateScoreFor</a>(<span class="keyword">const</span> TGameState&amp; state, <span class="keywordtype">size_t</span> depth)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;        <span class="comment">// Note: Need to negate results as they are from the enemys POV</span></div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;        <span class="keywordflow">if</span> (TRANSPOSITION_TABLES_ENABLED) {</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;            <span class="keyword">auto</span> entry = m_transpositionTable.<a class="code" href="class_transposition_table.html#a713913ddec0b13df5a271d9ef6a35e77">lookup</a>(state.getHash());</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;            <span class="keywordflow">if</span> (!entry) <span class="keywordflow">return</span> -state.getScore(depth);</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;            <span class="keywordflow">else</span> <span class="keywordflow">if</span> (entry-&gt;isUpperBound()) <span class="keywordflow">return</span> -MIN_SCORE;</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;            <span class="keywordflow">else</span> <span class="keywordflow">return</span> -entry-&gt;score;</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;            <span class="comment">// Greedy estimate based on next move</span></div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;            <span class="keywordflow">return</span> -state.getScore(depth);</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;        }</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;    }</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;    </div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;    <a class="code" href="class_transposition_table.html">TranspositionTable</a> m_transpositionTable;</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;    </div>
<div class="line"><a name="l00360"></a><span class="lineno"><a class="line" href="class_negamax.html#a6d19d69f8421dd568e1d0aa5448270cb">  360</a></span>&#160;    std::atomic&lt;bool&gt; <a class="code" href="class_negamax.html#a6d19d69f8421dd568e1d0aa5448270cb">m_abort</a>;</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;</div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;    Logging::Logger m_log;</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;};</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;<span class="preprocessor">#endif // NEGAMAX_H</span></div>
<div class="ttc" id="class_transposition_table_html_a5660b5b0b08775bbd270fc9b6f601176"><div class="ttname"><a href="class_transposition_table.html#a5660b5b0b08775bbd270fc9b6f601176">TranspositionTable::maybeUpdate</a></div><div class="ttdeci">void maybeUpdate(TranspositionTableEntry entry)</div><div class="ttdoc">Stores the given entry if it meets table replacement criteria. </div><div class="ttdef"><b>Definition:</b> TranspositionTable.h:108</div></div>
<div class="ttc" id="class_game_state_html"><div class="ttname"><a href="class_game_state.html">GameState</a></div><div class="ttdoc">Facade class for the game logic, holds the chessboard and the turn generator. </div><div class="ttdef"><b>Definition:</b> GameState.h:44</div></div>
<div class="ttc" id="struct_transposition_table_entry_html_a21cb85b29cd2ce47beb1dd33142972dd"><div class="ttname"><a href="struct_transposition_table_entry.html#a21cb85b29cd2ce47beb1dd33142972dd">TranspositionTableEntry::score</a></div><div class="ttdeci">Score score</div><div class="ttdoc">Estimated score (. </div><div class="ttdef"><b>Definition:</b> TranspositionTable.h:49</div></div>
<div class="ttc" id="struct_negamax_1_1_perf_counters_html_a790fb24a432ed457b9045a126159ca53"><div class="ttname"><a href="struct_negamax_1_1_perf_counters.html#a790fb24a432ed457b9045a126159ca53">Negamax::PerfCounters::nodes</a></div><div class="ttdeci">uint64_t nodes</div><div class="ttdoc">Number of nodes searched. </div><div class="ttdef"><b>Definition:</b> Negamax.h:152</div></div>
<div class="ttc" id="struct_transposition_table_entry_html_adc45c3e738f27e694c924a8df6d12302afb27cd323a1d9066ba4fd804b7f9b710"><div class="ttname"><a href="struct_transposition_table_entry.html#adc45c3e738f27e694c924a8df6d12302afb27cd323a1d9066ba4fd804b7f9b710">TranspositionTableEntry::LOWER</a></div><div class="ttdoc">Score is lower bound to score attainable by turn. </div><div class="ttdef"><b>Definition:</b> TranspositionTable.h:53</div></div>
<div class="ttc" id="struct_negamax_1_1_perf_counters_html_a645f00407c247bbb2f29666f722e3307"><div class="ttname"><a href="struct_negamax_1_1_perf_counters.html#a645f00407c247bbb2f29666f722e3307">Negamax::PerfCounters::updates</a></div><div class="ttdeci">uint64_t updates</div><div class="ttdoc">Number of best result updates during search. </div><div class="ttdef"><b>Definition:</b> Negamax.h:156</div></div>
<div class="ttc" id="struct_negamax_result_html_aba9695a07875203aa6c754501e113c3b"><div class="ttname"><a href="struct_negamax_result.html#aba9695a07875203aa6c754501e113c3b">NegamaxResult::score</a></div><div class="ttdeci">Score score</div><div class="ttdoc">Evaluator score estimation for this turn. </div><div class="ttdef"><b>Definition:</b> Negamax.h:52</div></div>
<div class="ttc" id="class_transposition_table_html"><div class="ttname"><a href="class_transposition_table.html">TranspositionTable</a></div><div class="ttdoc">Transposition table with fixed size. </div><div class="ttdef"><b>Definition:</b> TranspositionTable.h:86</div></div>
<div class="ttc" id="struct_transposition_table_entry_html_a8bd05e778a4778fa23ff10d2e8e11d0f"><div class="ttname"><a href="struct_transposition_table_entry.html#a8bd05e778a4778fa23ff10d2e8e11d0f">TranspositionTableEntry::turn</a></div><div class="ttdeci">Turn turn</div><div class="ttdoc">Best turn from this position. </div><div class="ttdef"><b>Definition:</b> TranspositionTable.h:48</div></div>
<div class="ttc" id="class_turn_html"><div class="ttname"><a href="class_turn.html">Turn</a></div><div class="ttdoc">Represents a chess turn. </div><div class="ttdef"><b>Definition:</b> Turn.h:40</div></div>
<div class="ttc" id="class_negamax_html_abfb76d2e30818cdaf93d77452cd7135b"><div class="ttname"><a href="class_negamax.html#abfb76d2e30818cdaf93d77452cd7135b">Negamax::search_recurse</a></div><div class="ttdeci">NegamaxResult search_recurse(TGameState state, size_t depth, const size_t maxDepth, Score alpha, Score beta)</div><div class="ttdoc">Recursive Negamax search with optional Alpha-Beta cutoff. </div><div class="ttdef"><b>Definition:</b> Negamax.h:211</div></div>
<div class="ttc" id="class_negamax_html_a66184104466386099085c2a434da9b1e"><div class="ttname"><a href="class_negamax.html#a66184104466386099085c2a434da9b1e">Negamax::abort</a></div><div class="ttdeci">void abort()</div><div class="ttdoc">Aborts the currently running calculation. </div><div class="ttdef"><b>Definition:</b> Negamax.h:141</div></div>
<div class="ttc" id="struct_negamax_1_1_perf_counters_html"><div class="ttname"><a href="struct_negamax_1_1_perf_counters.html">Negamax::PerfCounters</a></div><div class="ttdoc">Structure with performance counters used for debugging and evaluation. </div><div class="ttdef"><b>Definition:</b> Negamax.h:146</div></div>
<div class="ttc" id="struct_transposition_table_entry_html_adc45c3e738f27e694c924a8df6d12302adb28373902f1e677ebabe3990d92543c"><div class="ttname"><a href="struct_transposition_table_entry.html#adc45c3e738f27e694c924a8df6d12302adb28373902f1e677ebabe3990d92543c">TranspositionTableEntry::UPPER</a></div><div class="ttdoc">Score is upper bound to score attainable by turn. </div><div class="ttdef"><b>Definition:</b> TranspositionTable.h:54</div></div>
<div class="ttc" id="class_negamax_html"><div class="ttname"><a href="class_negamax.html">Negamax</a></div><div class="ttdoc">Implementation of a Negamax algorithm. </div><div class="ttdef"><b>Definition:</b> Negamax.h:93</div></div>
<div class="ttc" id="struct_negamax_result_html_addd03d676951914dde906d3f72c063b4"><div class="ttname"><a href="struct_negamax_result.html#addd03d676951914dde906d3f72c063b4">NegamaxResult::turn</a></div><div class="ttdeci">boost::optional&lt; Turn &gt; turn</div><div class="ttdoc">Turn to make to advance towards score. </div><div class="ttdef"><b>Definition:</b> Negamax.h:54</div></div>
<div class="ttc" id="struct_transposition_table_entry_html_a079ff462c7ade9cd06f34b0909181eb7"><div class="ttname"><a href="struct_transposition_table_entry.html#a079ff462c7ade9cd06f34b0909181eb7">TranspositionTableEntry::depth</a></div><div class="ttdeci">size_t depth</div><div class="ttdoc">Search depth used to evaluate position. </div><div class="ttdef"><b>Definition:</b> TranspositionTable.h:58</div></div>
<div class="ttc" id="struct_negamax_1_1_perf_counters_html_a77cda63ed3af0fb41ec4fff289229ee8"><div class="ttname"><a href="struct_negamax_1_1_perf_counters.html#a77cda63ed3af0fb41ec4fff289229ee8">Negamax::PerfCounters::duration</a></div><div class="ttdeci">std::chrono::milliseconds duration</div><div class="ttdoc">Time taken for last search. </div><div class="ttdef"><b>Definition:</b> Negamax.h:160</div></div>
<div class="ttc" id="class_negamax_1_1_option_html_a6c602b36d333a2ac81ce657378850e60"><div class="ttname"><a href="class_negamax_1_1_option.html#a6c602b36d333a2ac81ce657378850e60">Negamax::Option::operator&lt;</a></div><div class="ttdeci">bool operator&lt;(const Option &amp;other) const </div><div class="ttdoc">Odering operator which makes sort output descending by score. </div><div class="ttdef"><b>Definition:</b> Negamax.h:197</div></div>
<div class="ttc" id="class_negamax_html_a68c8b205384caa9099b5f58a960dc13a"><div class="ttname"><a href="class_negamax.html#a68c8b205384caa9099b5f58a960dc13a">Negamax::Negamax</a></div><div class="ttdeci">Negamax()</div><div class="ttdoc">Creates a new algorithm instance. </div><div class="ttdef"><b>Definition:</b> Negamax.h:98</div></div>
<div class="ttc" id="struct_negamax_result_html_ae379f4adbb195c5e48c10b583474b447"><div class="ttname"><a href="struct_negamax_result.html#ae379f4adbb195c5e48c10b583474b447">NegamaxResult::isVictoryCertain</a></div><div class="ttdeci">bool isVictoryCertain() const </div><div class="ttdoc">Returns true if the search found a certain victory. </div><div class="ttdef"><b>Definition:</b> Negamax.h:60</div></div>
<div class="ttc" id="struct_negamax_1_1_perf_counters_html_a4b44de710f2b2baa10d417d70df12205"><div class="ttname"><a href="struct_negamax_1_1_perf_counters.html#a4b44de710f2b2baa10d417d70df12205">Negamax::PerfCounters::cutoffs</a></div><div class="ttdeci">uint64_t cutoffs</div><div class="ttdoc">Number of branches cut-off using Alpha-Beta. </div><div class="ttdef"><b>Definition:</b> Negamax.h:154</div></div>
<div class="ttc" id="class_negamax_html_a975aeca01f30cba138118127f7c541d2"><div class="ttname"><a href="class_negamax.html#a975aeca01f30cba138118127f7c541d2">Negamax::estimateScoreFor</a></div><div class="ttdeci">Score estimateScoreFor(const TGameState &amp;state, size_t depth) const </div><div class="ttdoc">Estimates score for given state. </div><div class="ttdef"><b>Definition:</b> Negamax.h:344</div></div>
<div class="ttc" id="struct_transposition_table_entry_html_adc45c3e738f27e694c924a8df6d12302a0ce401f3ea88d764db8bd6a2bd5bccb1"><div class="ttname"><a href="struct_transposition_table_entry.html#adc45c3e738f27e694c924a8df6d12302a0ce401f3ea88d764db8bd6a2bd5bccb1">TranspositionTableEntry::EXACT</a></div><div class="ttdoc">Score is exactly what is attainable by turn. </div><div class="ttdef"><b>Definition:</b> TranspositionTable.h:55</div></div>
<div class="ttc" id="struct_transposition_table_entry_html"><div class="ttname"><a href="struct_transposition_table_entry.html">TranspositionTableEntry</a></div><div class="ttdoc">Single entry in transposition table. </div><div class="ttdef"><b>Definition:</b> TranspositionTable.h:46</div></div>
<div class="ttc" id="class_negamax_1_1_option_html_a904d5a20885f7018224eafbaee3d2651"><div class="ttname"><a href="class_negamax_1_1_option.html#a904d5a20885f7018224eafbaee3d2651">Negamax::Option::Option</a></div><div class="ttdeci">Option(TGameState &amp;state, Turn &amp;turn, Score score)</div><div class="ttdoc">Create options for move ordering. </div><div class="ttdef"><b>Definition:</b> Negamax.h:188</div></div>
<div class="ttc" id="struct_negamax_result_html_a8cdb8ae1ae4a4713ae6ef8cc98f3b1a0"><div class="ttname"><a href="struct_negamax_result.html#a8cdb8ae1ae4a4713ae6ef8cc98f3b1a0">NegamaxResult::operator-</a></div><div class="ttdeci">NegamaxResult operator-() const </div><div class="ttdoc">Negates score. Syntax sugar to get closer to algorithm notation. </div><div class="ttdef"><b>Definition:</b> Negamax.h:57</div></div>
<div class="ttc" id="struct_negamax_result_html"><div class="ttname"><a href="struct_negamax_result.html">NegamaxResult</a></div><div class="ttdoc">Structure for holding search results. </div><div class="ttdef"><b>Definition:</b> Negamax.h:50</div></div>
<div class="ttc" id="struct_negamax_1_1_perf_counters_html_a3d65699a6a64b8d20b9b8e04e041f319"><div class="ttname"><a href="struct_negamax_1_1_perf_counters.html#a3d65699a6a64b8d20b9b8e04e041f319">Negamax::PerfCounters::transpositionTableHits</a></div><div class="ttdeci">uint64_t transpositionTableHits</div><div class="ttdoc">Number of transposition table hits during search. </div><div class="ttdef"><b>Definition:</b> Negamax.h:158</div></div>
<div class="ttc" id="class_negamax_html_a98943353b28ca48b5a696993fabd8a39"><div class="ttname"><a href="class_negamax.html#a98943353b28ca48b5a696993fabd8a39">Negamax::search</a></div><div class="ttdeci">NegamaxResult search(const TGameState &amp;state, size_t maxDepth)</div><div class="ttdoc">Search given state up to maxDepth full turns. </div><div class="ttdef"><b>Definition:</b> Negamax.h:111</div></div>
<div class="ttc" id="class_transposition_table_html_a713913ddec0b13df5a271d9ef6a35e77"><div class="ttname"><a href="class_transposition_table.html#a713913ddec0b13df5a271d9ef6a35e77">TranspositionTable::lookup</a></div><div class="ttdeci">boost::optional&lt; TranspositionTableEntry &gt; lookup(Hash hash) const </div><div class="ttdoc">Lookup hash in table. </div><div class="ttdef"><b>Definition:</b> TranspositionTable.h:122</div></div>
<div class="ttc" id="class_negamax_1_1_option_html_a33bfa15db2d737b4d3f6bc8d28d762c5"><div class="ttname"><a href="class_negamax_1_1_option.html#a33bfa15db2d737b4d3f6bc8d28d762c5">Negamax::Option::score</a></div><div class="ttdeci">Score score</div><div class="ttdoc">Score estimation for this option. </div><div class="ttdef"><b>Definition:</b> Negamax.h:200</div></div>
<div class="ttc" id="class_negamax_html_a6d19d69f8421dd568e1d0aa5448270cb"><div class="ttname"><a href="class_negamax.html#a6d19d69f8421dd568e1d0aa5448270cb">Negamax::m_abort</a></div><div class="ttdeci">std::atomic&lt; bool &gt; m_abort</div><div class="ttdoc">Abort flag. </div><div class="ttdef"><b>Definition:</b> Negamax.h:360</div></div>
<div class="ttc" id="struct_transposition_table_entry_html_a03beac3a305cdbb97c721a8d8a5cee85"><div class="ttname"><a href="struct_transposition_table_entry.html#a03beac3a305cdbb97c721a8d8a5cee85">TranspositionTableEntry::hash</a></div><div class="ttdeci">Hash hash</div><div class="ttdoc">Hash identifying position (might collide) </div><div class="ttdef"><b>Definition:</b> TranspositionTable.h:47</div></div>
<div class="ttc" id="class_negamax_1_1_option_html"><div class="ttname"><a href="class_negamax_1_1_option.html">Negamax::Option</a></div><div class="ttdoc">Helper class for holding a move option in move ordering. </div><div class="ttdef"><b>Definition:</b> Negamax.h:180</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Mar 9 2014 23:12:55 for 3dchess by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
